package com.shop.web.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.shop.domain.Order;
import com.shop.domain.User;
import com.shop.service.OrderService;

/**
 * 商品上传
 * 
 * @author Administrator
 * 
 */
public class DelOrderServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3711980669364366170L;

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		OrderService service = new OrderService();
		
		String id = request.getParameter("id");
		User user = (User) request.getSession().getAttribute("loginUser");
		service.delOrderByID(id, user);
		
		request.getRequestDispatcher("/listOrders").forward(request, response);
	}

}
